package com.albb.order.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RequestMapping("/order")
@RestController
public class OrderController {

    @Autowired
    private RestTemplate restTemplate;

    @RequestMapping("/addOrder")
    public String addOrder(String id) {
        System.out.println("addOrder开始新增id:");
        String str = restTemplate.getForObject("http://stock-service/scotk/delStock", String.class);
        System.out.println("addOrder新增id:" + str);
        return str;
    }


}
